package com.ljy.tkmodel.controller;


import com.ljy.tkmodel.entity.Teacher;
import com.ljy.tkmodel.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author testjava
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/teacher")
public class TeacherController {
    @Autowired
    TeacherService teacherService;

    @PostMapping("initTeacher")
    public Integer initTeacher(Teacher teacher){
        return teacherService.addTeacher(teacher);
    }

    @GetMapping("queryConditionTeacher")
    public List<Teacher> queryConditionTeacher(@RequestParam(value = "Map",required = false)Map map){
        return teacherService.selectTeacher(map);
    }
}

